<template>
  <!-- Main content -->
  <div>
    <section class="main-content">
      <div class="row">
        <section class="col-md-9 left-part">
          <!--订单 工单-->
          <orderCom :orderTk="orderTk" :orderFlag="orderFlag" :complainFlag="complainFlag">

          </orderCom>
          <complainCom :complain="complain" :orderFlag="orderFlag" :complainFlag="complainFlag">

          </complainCom>
          <!--在线通知-->
          <onlineNotice>

          </onlineNotice>
          <!--常用菜单 -->
          <customMenu>

          </customMenu>

          <!--外部链接 quickUrlContainer-->
          <quickUrlContainer>

          </quickUrlContainer>
        </section>
        <section class="col-md-3 right-part">
          <!--抽奖活动入口-->
          <!--<luckDraw></luckDraw>-->

          <!--新手引导-->
          <guide>

          </guide>

          <!--关心数据-->
          <biChart>

          </biChart>

          <!--运单异常-->
          <weyBillExp>

          </weyBillExp>
          <!--公告-->
          <notice>

          </notice>
          <!--便签-->
          <note>

          </note>
        </section>
      </div>
    </section>
    <!--全局悬浮按钮-->
    <fixedButton>

    </fixedButton>
  </div>
</template>

<script>
  import onlineNotice from './OnlineNotice'
  import customMenu from './CustomMenu'
  import orderCom from  './orderCom'
  import complainCom from  './complainCom'
  import quickUrlContainer from './QuickUrlContainer'
  import guide from './Guide'
  import biChart from './BiChart'
  import notice from './Notice'
  import note from './Note'
  import weyBillExp from './weyBillExp'
  import fixedButton from './fixedButton'
  import luckDraw from './LuckDraw'
  import axios from 'axios'
    export default {
        name: "section-com",
        data(){
          return{
              orderTk:{'data':{'uapOrderVO':{'currentWaitOrderNumber':0,'currentNumber':0,'currentTime':'','uapOrders':{}}}},
              complain:{'data':{'totalCount':0,'complaintList':{}}},
              orderFlag:false,
              complainFlag:false
          }
        },
        computeds:{

        },
      components:{
        onlineNotice:onlineNotice,
        customMenu:customMenu,
        orderCom:orderCom,
        complainCom:complainCom,
        quickUrlContainer:quickUrlContainer,
        guide:guide,
        biChart:biChart,
        notice:notice,
        note:note,
        weyBillExp:weyBillExp,
        fixedButton:fixedButton,
        luckDraw:luckDraw
      },
        mounted(){
           this.getOrderList();
           this.getComplainList();
        },
        methods:{
           getOrderList(){
               this.axios.post(OMS_SERVER_NAME + "oms-ltl-web/uaporder/queryOrder.action",{"uapOrderVO.uapOrderCondition.deptCode":userInfo.deptCode}).then(response =>{
                    if(response.data && response.data.uapOrderVO){
                        //未处理订单
                        this.orderTk.data.uapOrderVO.currentWaitOrderNumber = response.data.uapOrderVO.currentWaitOrderNumber;
                        //今日处理订单
                        this.orderTk.data.uapOrderVO.currentNumber = response.data.uapOrderVO.currentNumber;
                        this.orderTk.data.uapOrderVO.currentTime = response.data.uapOrderVO.currentTime;
                        if(response.data.uapOrderVO.uapOrders.length > 0){
                            this.orderTk.data.uapOrderVO.uapOrders = response.data.uapOrderVO.uapOrders;
                            this.orderFlag = true;
                        }else {
                            this.orderFlag = false;
                        }
                    }else{
                        this.orderTk.orderFlag = false;
                    }
                }).catch(error =>{
                   this.orderTk.orderFlag = false;
                  })
            },
            getComplainList(){
                this.axios.post(CRM_SERVER_NAME+"crm-web/complaint/searchDeptComplaintList.action",{ "condition.numValue":'',
                    "page":1,
                    "start":0,
                    "limit":10}).then(response =>{
                    if(response.data.success){
                        if(response.data.complaintList.length>0){
                            this.complain.data.totalCount = response.data.totalCount;
                            this.complain.data.complaintList = response.data.complaintList;
                            this.complainFlag = true;
                        }else{
                            this.complainFlag = false;
                        }
                    }else{
                        this.complainFlag = false;
                    }
                }).catch(error =>{
                    this.complainFlag = false;
                });
            }
        }
    }
</script>

<style scoped>

</style>
